# while打印四种格式的九九乘法表
print("第一种")
# 声明行 变量 并赋值为1
index_one = 1
# 开始循环 行小于10
while index_one < 10:
    # 声明列变量 并赋值为1
    index_two = 1
    # 开始循环 列小于等于行
    while index_two <= index_one:
        # 通过Format拼接等式字符串
        Result = "{}x{}={:<3}".format(index_one,index_two,index_one * index_two)
        # 打印等式并消除换行
        print(Result, end='')
        # 列自增1
        index_two = index_two + 1
    # 行自增1
    index_one = index_one + 1
    # 换行
    print("")

print("第二种")
index_three = 1
# 开始循环 1-9 作为行
while index_three <= 9 :
    index_four = index_three
    # 开始循环列 从行数开始到9
    while index_four <= 9 :
        # 通过format拼接等式信息
        Result = "{}x{}={:<3}".format(index_three,index_four,index_three * index_four)
        # 打印等式信息并消除换行
        print(Result, end='')
        # 列自增1
        index_four = index_four + 1
    # 行自增1
    index_three = index_three + 1
    # 换行
    print("")
print("第三种")

index_five = 1
# 循环1-9作为行
while index_five <= 9:
    index_six = index_five
    index_temp=index_five
    # 循环当前行数，打印空白格进行缩进
    while index_temp > 1:
        print("{:<6}".format(" "),end=' ')
        index_temp = index_temp - 1
    # 循环行数-9 做为列
    while index_six <= 9:
        # 通过format拼接等式信息
        Result = "{}x{}={:<3}".format(index_five,index_six,index_five * index_six)
        # 打印等式并消除换行
        print(Result, end='')
        # 列自增1
        index_six = index_six + 1
    # 行自增1
    index_five = index_five + 1
    print("")

print("第四种")
index_seven = 1
# 循环1-9作为行
while index_seven <= 9:
    index_eight = 1
    index_stemp = index_seven
    # 循环 打印空白格，进行行缩进
    while (9 - index_stemp) > 0:
        print("{:<6}".format(" "),end=' ')
        index_stemp = index_stemp + 1
    # 循环列
    while index_eight <= index_seven:
        # 通过format拼接等式
        Result = "{}x{}={:<3}".format(index_seven,index_eight,index_seven * index_eight)
        # 打印等式并消除换行
        print(Result,end='')
        # 列自增1
        index_eight = index_eight + 1
    # 行自增1
    index_seven = index_seven + 1
    print("")


